/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package GUI;

import java.awt.Graphics;
import java.awt.Image;
import java.io.File;
import java.io.IOException;
import javax.imageio.ImageIO;
import javax.swing.JPanel;


/**
 *
 * @author CRISTINA
 */
public class ImagePanel extends JPanel{ 

    private Image imagen;
    
    public ImagePanel(Image imagen) {  
        
        this.imagen=imagen;
        try {                           
            imagen = ImageIO.read(new File("image name and path"));
        }catch (IOException ex) {             
            // handle exception...        
        }     
    } 

    @Override     
    public void paintComponent(Graphics g) {         
        g.drawImage(imagen, 0, 0, null);
    } // see javadoc for more info on the parameters      }  
    
}